#ifndef SWEGL_VERTEX_BUFFER_H
#define SWEGL_VERTEX_BUFFER_H

#include "swegl/common.h"

namespace swegl
{

class VertexBuffer
{
public:
	VertexBuffer();
	~VertexBuffer();
	
	void init(size_t size);
	
	size_t size() const { return m_size; }
	
	void *data() { return m_data; }
	template<typename T> T *data();
	
	const void *data() const { return m_data; }
	template<typename T> const T *data() const;
	
	uint8 *m_data;
	size_t m_size;
};

template<typename T>
inline T *VertexBuffer::data()
{
	return static_cast<T *>(data());
}

template<typename T>
inline const T *VertexBuffer::data() const
{
	return static_cast<const T *>(data());
}

}

#endif 
